<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>上海长城宽带汪正影业宝贝拍摄体验报名，当小萌主遇上大镜头</title>
    <link type="text/css" rel="stylesheet" href="css/babycamera.css" />
    <script type="text/javascript" src="js/myData.js"></script>
    <script type="text/javascript" src="js/jquery-1.11.0.js"></script>
    <script>
        var loc = "上海";
        var lif = "男";
        jQuery.noConflict();
        jQuery(function () {
            jQuery("#addphone").change(function () {
                if (jQuery("#addphone").val().length !== 11) {
                    jQuery(".msg1_mask").show()
                } else {
                    jQuery(".msg1_mask").hide()
                }
            })
            jQuery("#shanghai").click(function () {
                if (jQuery("#shanghai").is(":checked")) {
                    jQuery(".op").hide()
                } else {
                    jQuery(".op").show()
                }
            })
            jQuery("#noshanghai").click(function () {
                if (jQuery("#shanghai").is(":checked")) {
                    jQuery(".op").hide()
                } else {
                    jQuery(".op").show()
                }
            })
            jQuery(".xx").click(function () {
                jQuery(".enlist").hide();
                jQuery(".meng").hide();
                jQuery(".enlist1").hide();
                jQuery(".meng1").hide();
                jQuery(".send").text("发送验证码");
                jQuery(".send").css("background", "#e73844");
                jQuery(".msg1_mask").hide();
                jQuery("#addphone").val("");
                jQuery("#shanghai").prop("checked", true);
                jQuery(".rang").prop("checked", true);
                jQuery(".op").hide();
                jQuery(".chang").val("");
                jQuery(".zhong").val("");
                jQuery(".duan").val("");

            })
            jQuery(".baoming").click(function () {
                jQuery(".enlist").show();
                jQuery(".meng").show();
            })
            jQuery(".para").click(function(){
                jQuery(this).hide();
                jQuery(".diandian").hide();
                jQuery(".panishou").hide();
                jQuery(".wrap").show();
                addMyData();   
			})
            jQuery(".diandian").click(function(){
                jQuery(this).hide();
                jQuery(".para").hide();
                jQuery(".panishou").hide();
                jQuery(".wrap").show();
                addMyData();   
		    })
            jQuery(".panishou").click(function(){
                jQuery(this).hide();
                jQuery(".para").hide();
                jQuery(".diandian").hide();
                jQuery(".wrap").show();
                addMyData();   
			})
            jQuery(".content i").hover(function(){
           	    jQuery(this).addClass('on');
           	    jQuery(".content i").not(this).addClass('off');
           	    },function(){
           	    jQuery(this).removeClass('on');
           	    jQuery(".content i").not(this).removeClass('off');
                }
            )
            jQuery(window).scroll(function () {
                var dd = jQuery(window).scrollTop()

                switch (true) {
                    case dd < 100:
                        jQuery(".baby5").removeClass('move3').addClass('move1');
                        jQuery(".baby1").removeClass('move4').addClass('move2');
                        break;
                    case dd > 100:
                        jQuery(".baby1").removeClass('move2').addClass('move4');
                        jQuery(".baby5").removeClass('move1').addClass('move3');
                        break;
                }


            })
            //              loc就是选择的地点
            jQuery(".op").click(function () {
                var waidi = jQuery(".op").val();
                loc = waidi;

            })
            jQuery("#noshanghai").click(function () {
                var waidi = jQuery(".op").val();
                loc = waidi;

            })
            jQuery("#shanghai").click(function () {
                loc = "上海";

            })
            //lif就是男女
            jQuery(".rang").click(function () {
                lif = "男";

            })
            jQuery(".majing").click(function () {
                lif = "女";

            })
            jQuery(".baby2").delay(500).fadeIn(1200);
            jQuery(".baby3").delay(1300).fadeIn(1200);
            jQuery(".baby4").delay(1000).fadeIn(1200);
            jQuery(".baby1").delay(2000).addClass('move2');
            jQuery(".baby5").delay(2500).addClass('move1');
        })
    </script>
    <script src="js/Common.js"></script>
    <script src="js/BabyCamera.js"></script>
</head>
<body>
    <div class="all">
        <div class="content">
        	<a href="javascript:;"><img class="shine panishou superman1" src="img/panishou_05.png"></a>
			<a href="javascript:;"><img class="diandian ruler" src="img/zizitaohua.png"></a>
            <a id="para" class="para shine" href="#para">
                <img src="img/jingtou.png"></a>
            <a href="http://www.gwbnsh.net.cn/" target="_blank" class="company"></a>
            <a href="" target="_blank" class="wangzheng"></a>
            <a href="http://www.gwbnsh.net.cn/" target="_blank" class="company1"></a>
            <a href="" target="_blank" class="wangzheng2"></a>

            <i>
                <img class="baby2 baby" style="display: none;" src="img/baby2.png"></i>

            <i>
                <img class="baby4 baby" style="display: none;" src="img/baby4.png"></i>

            <img class="dayun" src="img/dayun.png">
            <i>
                <img class="baby1 baby " src="img/baby1.png"></i>
            <i>
                <img class="baby5 baby " src="img/baby5.png"></i>







            <img class="dongyun1 yun" src="img/dongyun5.png">
            <img class="dongyun2 yun" src="img/dongyun2.png">
            <img class="wanwanzi" src="img/wanwanzi.png">
            <img class="xiaoyun" src="img/xiaoyun.png">
            <img class="xiaoyun2" src="img/xiaoyuny2.png">
            <i>
                <img class="baby3 baby" style="display: none;" src="img/baby3.png"></i>

            <img class="zuzu" src="img/zuzu.png">
            <img class="zhongzi" src="img/zhongzi.png">
            <img class="zizi20" src="img/zizi20.png">
            <img class="zizitaohua" src="img/zizitaohua.png">
            <img class="jingtou" src="img/jingtou.png">
            <img class="dongyun9 yun" src="img/dongyun5.png">
            <img class="dongyun6 yun" src="img/dongyun5.png">
            <img class="dongyun3 yun" src="img/dongyun3.png">
            <img class="dongyun5 yun" src="img/dongyun5.png">
            <img class="dongyun4 yun" src="img/dongyun5.png">
            <img class="dongyun7 yun" src="img/dongyun7.png">
            <img class="dongyun8 yun" src="img/dongyun8.png">
            <img class="left5 superman1" src="img/left_05.jpg">
            <img class="middle5 superman1" src="img/middle_05.jpg">
            <img class="right5 superman1" src="img/right_05.jpg">
            <img class="lefttou superman1" src="img/lefttou.png">
            <img class="righttou superman1" src="img/righttou.png">


            <!--图片墙部分-->
            <div id="wrap" class="wrap" style="display: none;">
                <div class="photo" id="photo_{{index}}" onclick="turn(this)">
                    <div class="photo_wrap">
                        <div class="side side_front">
                            <div class="image">
                                <img class="yigege" src="img/{{img}}" />
                            </div>
                            <div class="capation">
                                <!--{{caption}}-->
                            </div>
                        </div>
                        <div class="side side_back">
                            <div class="desc">
                                {{desc}}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <a href="#" class="baoming">我要报名</a>
            <div class="address">
                <p class="shangmen">上海地区拍摄自选地点</p>
                <p class="shangmen1">韩童私家别墅影像会馆：上海市静安区莫干山路101号 上海著名的“艺术家群落”（别墅内实景+私家花园外景，服务0-6岁幼童）</p>
                <p class="shangmen2">9V儿童纪实摄影：上海市普陀区中山北路3222号 月星环球港3层L3113、L3115（商场主题潮流街拍，服务1-10岁宝宝）</p>
                <p class="shangmen3">9V肖像馆：上海市杨浦区翔殷路1099号 上海合生国际广场4楼（黑白灰背景时尚杂志封面+广告大片，服务2-8岁宝宝）</p>
                <p class="shangmen4">9V街拍影像会馆：上海市黄浦区南京东路228号 新世界大丸百货6楼（商场主题潮流街拍，服务1-10岁宝宝）</p>
                <p class="shangmen5">*上海以外城市，工作人员将通过电话与您沟通具体拍摄地点和时间。</p>
            </div>
            <img class="jiji" src="img/jiji.png">

            <div class="tips">
              	<p class="tip">活动须知：</p>
              	<p class="tip1"><span class="circle"></span>本活动为专属体验活动，全程无隐形附加费用收取，且无版权赠送。参与拍摄的宝</p>
              	<p class="tip2">贝年龄限制为0-6岁（上海、南京为0-10岁）。</p>
              	<p class="tip1" style="margin-top: 10px;"><span class="circle"></span>为确保拍摄与服务质量，汪正影业将在7-15个工作日内与客户约拍，并确定具体拍</p>
              	<p class="tip2">摄门店与时间。</p>
              	<p class="tip1" style="margin-top: 10px;"><span class="circle"></span>台历制作完成后，汪正影业将通知客户到店领取，如不便自领，可申请顺丰到付。</p>
              	<p class="tip1" style="margin-top: 10px;"><span class="circle"></span>本活动仅限2016年未参与过体验拍摄的非汪正会员，每个家庭仅限参与一次（即拍</p>
              	<p class="tip2">摄一套），不可与其他体验活动同享。</p>
              	<p class="tip1" style="margin-top: 10px;"><span class="circle"></span>本活动不可兑换现金，不可折合成其他产品。</p>
                <p class="tip1" style="margin-top: 10px;"><span class="circle"></span>报名从速，名额有限。拍摄有效期截止至2016年12月31日。</p>
              	<p class="tip7">*上海长城宽带和汪正影业国际儿童摄影机构享有活动解释权。</p>
            </div>
            <img class="kk" src="img/kk.png">




            <script>
                function $(selector) {
                    var method = selector.substr(0, 1) == "." ? "getElementsByClassName" : "getElementById";
                    return document[method](selector.substr(1));
                }

                function turn(elem) {
                    var cls = elem.className;
                    var n = elem.id.split("_")[1];
                    if (!/photo_center/.test(cls)) {
                        rsort(n);
                        return;
                    }
                    if (/photo_front/.test(cls)) {
                        cls = cls.replace('photo_front', 'photo_back');
                        $('.i')[n].className = $('.i')[n].className.replace(/i_current/, 'i_back');
                    }
                    else if (/photo_back/.test(cls)) {
                        cls = cls.replace('photo_back', 'photo_front');
                        $('.i')[n].className = $('.i')[n].className.replace(/i_back/, 'i_current');
                    }
                    return elem.className = cls;
                }


                //遍历myData数据长度 , 写入html ;加载图片的时候 , 还顺带加上对应数量的导航:
                function addMyData() {
                    var template = $("#wrap").innerHTML;  //取出wrap里面的值,作为模板,  留待后面替换
                    var oHtml = [];                   //存储要替换的内容
                    var oNav = [];
                    for (var i = 0 ; i < myData.length; i++) {
                        var _html = template.replace('{{index}}', i)
                                .replace('{{alt}}', myData[i].caption)
                                .replace('{{img}}', myData[i].img)
                                .replace('{{caption}}', myData[i].caption)
                                .replace('{{desc}}', myData[i].desc)
                        oHtml.push(_html);
                        oNav.push('<span id="nav_' + i + '" class="i" onclick ="turn($(\'#photo_' + i + '\'))"></span>');
                    }
                    //遍历创建完成之后 , 不但要把图片传禁区 , 还要把对应 的nav导航条假如:
                    oHtml.push('<div class="nav" id="nav">' + oNav.join("") + '</div>');
                    $("#wrap").innerHTML = oHtml.join("");
                    //图片加载后调用一下随机抽取居中图片:
                    rsort(random([0, myData.length - 1]));
                }
                //调用函数 , 载入图片 .

                //取得在特定范围内随机的值:
                function random(range) {
                    var min = Math.min(range[0], range[1]);
                    var max = Math.max(range[0], range[1]);
                    var diff = max - min + 1;//[3,5]
                    var n = Math.floor(diff * Math.random()) + min;
                    return n;
                }

                //取得左右区域图片的取值活动范围:
                function range() {
                    //定义json数组格式:返回对象
                    var range = {
                        left: {
                            x: [], y: []
                        },
                        right: {
                            x: [], y: []
                        }
                    }
                    var wrap = {
                        w: $("#wrap").clientWidth,
                        h: $("#wrap").clientHeight
                    }
                    var photo = {
                        w: $(".photo")[9].clientWidth,
                        h: $(".photo")[9].clientHeight
                    }
                    range.wrap = wrap;            //向json里面添加json元素.
                    range.photo = photo;

                    //定义left的xy值范围 , 和right的xy范围值.
                    range.left.x=[0-photo.w/10,wrap.w/2-photo.w/2];                     //定义json数组中的元素 , 用.方法.
                    range.left.y=[0-photo.h/2,wrap.h-photo.w/10];

                    range.right.x=[wrap.w/2-photo.w/2,wrap.w-photo.w/2];                     //定义json数组中的元素 , 用.方法.
                    range.right.y=[0-photo.h/2,wrap.h-photo.w/10];

                    return range;
                }
                //随机选取一个作为中间的特殊元素,及两边排序.
                function rsort(n) {
                    //获取所有的photo , 准备排序
                    var _photo = $(".photo");
                    var photos = [];
                    for (var i = 0 ; i < _photo.length; i++) {
                        _photo[i].className = _photo[i].className.replace(/\s*photo_center\s*/, " ");
                        _photo[i].className = _photo[i].className.replace(/\s*photo_front\s*/, " ");
                        _photo[i].className = _photo[i].className.replace(/\s*photo_back\s*/, " ");

                        _photo[i].className += " photo_front ";
                        _photo[i].style.left = "";
                        _photo[i].style.top = "";
                        _photo[i].style['-webkit-transform'] = "rotate(360deg) scale(1.3)";

                        photos.push(_photo[i]);
                    }
                    //定义一张随机图片居中显示:
                    var photo_center = $("#photo_" + n);
                    photo_center.className += " photo_center ";

                    //剔除掉居中显示图片 :
                    photo_center = photos.splice(n, 1);
                    //定义变量存储数据值
                    var ranges = range();
                    var photos_left = photos.splice(0, Math.ceil(photos.length / 2));
                    var photos_right = photos;
                    //通过随机的left和top值 , 随意排列图片:
                    for(var j =0 ;j<photos_left.length;j++){
                    photos_left[j].style.left = random(ranges.left.x)+120+"px";
                    photos_left[j].style.top = random(ranges.left.y)/1.8+110+"px";
                    photos_left[j].style["-webkit-transform"] ="rotate("+random([-100,100])+"deg) scale(1)";
                    }

                    for(var s =0 ;s<photos_right.length;s++){
                    photos_right[s].style.left = random(ranges.right.x)+120+"px";
                    photos_right[s].style.top = random(ranges.right.y)/1.8+110+"px";
                    photos_right[s].style["-webkit-transform"] ="rotate("+random([-100,100])+"deg) scale(1)";
                    }
                    //图片排序后 , 顺带选出当前选中按钮:
                    var navs = $('.i');
                    for (var i = 0 ; i < navs.length; i++) {
                        //统一先清空:

                        navs[i].className = navs[i].className.replace(/\s*i_current\s*/, '');
                        navs[i].className = navs[i].className.replace(/\s*i_back\s*/, '');
                    }
                    navs[n].className += " i_current ";
                }



            </script>




        </div>
        <div class="meng" style="display: none;">
            <div class="enlist" style="display: none;">
                <img class="xinxi" src="img/enlist_08.jpg">
                <img class="grass" src="img/grass.png">
                <div class="shuru">
                    <label>家长姓名：</label><input id="familyName" class="chang" type="text" /><span style="color: #e73844;">(必填)</span>
                    <label>家长手机号：</label><input id="addphone" class="chang" type="text" /><span style="color: #e73844;">(必填)</span>
                    <label>验证码：</label><input id="yzm" class="zhong" type="text" /><span style="color: #e73844;">(必填)</span><a class="send" onclick="SendMessage()" href="javascript:;">发送验证码</a>
                    <label>儿童姓名：</label><input id="childName" class="chang" type="text" /><span>(选填)</span>
                    <label>儿童性别：</label>
                    <input class="rang" type="radio" style="margin-left: 20px; margin-right: 10px;" value="男" name="sex" checked="checked">男
                            <input class="majing" type="radio" style="margin-left: 35px; margin-right: 10px;" value="女" name="sex">女
              	    <br>
                   <label>儿童年龄：</label><input id="ChildAge" class="duan" type="text" onkeyup="(this.v=function(){this.value=this.value.replace(/[^0-9-]+/,'');if(this.value>10){this.value=10};if(this.value.length>2){this.value=0}}).call(this)" onblur="this.v();" runat="server" /><span>周岁（上海与南京限0-10岁，其余城市限0-6岁）</span>
                    <label>所在城市：</label>
                    <input id="shanghai" type="radio" checked="checked" style="margin-left: 20px; margin-right: 10px;" value="上海" name="address">上海
                    <input id="noshanghai" type="radio" style="margin-left: 20px; margin-right: 10px;" value="上海以外" name="address">上海以外
              	    <select class="op" style="display: none;">
                          <option value="南京">南京</option>
                          <option value="沈阳">沈阳</option>
                          <option value="天津">天津</option>
                          <option value="北京">北京</option>
                          <option value="成都">成都</option>
                          <option value="大连">大连</option>
                      </select>
                    <input type="hidden"  id="input_address"/>
                    <a class="submit" onclick="AddUserInfo()" href="javascript:;">确认提交</a>
                </div>
                <p class="msg1_mask" style="display: none;">您输入的电话位数不对，请重新输入</p>
                <a href="#">
                    <img class="xx" src="img/xx.png"></a>
            </div>
        </div>

        <div class="meng1" style="display: none;">
            <div class="enlist1" style="display: none;">
                <img class="xinxi" src="img/enlist_08.jpg">
                <img class="grass" src="img/grass.png">
                <div class="shuru">
                    <label>家长姓名：</label><span id="s1" style="margin-left: 90px; font-size: 30px;">你爸爸</span>
                    <br>
                    <label>家长手机号：</label><span id="s2" style="margin-left: 90px; font-size: 30px;">110</span>
                    <br>
                    <label>儿童姓名：</label><span id="s3" style="margin-left: 90px; font-size: 30px;">秦始皇</span>
                    <br>
                    <label>儿童性别：</label><span id="s4" style="margin-left: 90px; font-size: 30px;">男</span>
                    <br>
                    <label>儿童年龄：</label><span id="s5" style="margin-left: 90px; font-size: 30px;">10周岁</span>
                    <br>
                    <label>所在城市：</label><span id="s6" style="margin-left: 90px; font-size: 30px;">上海</span>
                    <a class="submit">报名成功</a>
                </div>

                <a href="javascript:;">
                    <img class="xx" src="img/xx.png"></a>
            </div>
        </div>
    </div>
<div style="display:none;">
    <script src="http://s20.cnzz.com/stat.php?id=5217658&web_id=5217658&show=pic" language="JavaScript"></script>
    <script>
        var _hmt = _hmt || [];
        (function () {
            var hm = document.createElement("script");
            hm.src = "//hm.baidu.com/hm.js?84ff62217a1dc70b20296739785a5ed1";
            var s = document.getElementsByTagName("script")[0];
            s.parentNode.insertBefore(hm, s);
        })();
</script>
</div>
</body>
</html>